<%include file="header.tpl"/>

<div class="wrapper lineT">
  <div class="mainBox">
    <div class="main">
<%include file="leftside.tpl"/>
      <div class="dedeCenter" id="personal">
	<div class="fangle">
          <dl class="artList mL10 mR10">
			<form method="post">
				<table style="width: 100%; float: left;" align="left" class="edittable">
				  <tr>
					  <th colspan="5" class="formtitle">评论管理</th>
					</tr>
					<tr>
						<td width=3%>删</td>
						<td width=7%>编辑</td>
						<td width=50%>内容</td>
						<td width=15%>文章</td>
						<td width=15%>作者</td>
						<td width=10%>时间</td>
					</tr>
					%for comment in comments:
					<tr>
						<td><input name="del" value="${comment.key().id()}" type="checkbox" /></td>
						<td><a href='/admincp/comment/edit/${comment.key().id()}'>编辑</a></td>
						%if len(comment.content)>100:
						<td>${comment.content[0:100]}...</td>
						%else:
						<td>${comment.content}</td>
						%endif
						<%from model import BlogModel%>
						<%dairy = BlogModel.get_by_id(ids=comment.dairyid)%>
						<td><a href="/blog/${dairy.year}/${dairy.month}/${dairy.day}/${dairy.url}.html">${dairy.title}</a></td>
						<td><a href='${comment.webpage}'>${comment.author}</a></td>
						<td>${comment.time.strftime('%Y-%m-%d %H:%M:%S')}</td>
					</tr>
					%endfor
					<tr>
					  <td><input name="deletebox" type="checkbox" onclick="$('input[name=del]').attr('checked',this.checked);" /></td>
					  <td><input name="delete" type="submit" value="删除" /></td>
					  <td>
					  %if link['prev']:
						<div class="pages" style="float:right"><a href="/admincp/comment/page/${link['page_index']-1}">上一页</a></div>
					  %endif
					  </td>
					  <td><div class="pages">第${num}页，共${link['last']}页</div></td>
					  <td>
					  %if link['next']:
						<div class="pages"><a href="/admincp/comment/page/${link['page_index']+1}">下一页</a></div>
					  %endif
					  </td>
					</tr>
				</table>
			 </form>
        </div>
      </div>
      <div class="clear"></div>
    </div>
<%include file="rightside.tpl"/>
  </div>
</div>
<%include file="footer.tpl"/>
